<template>
  <div class="B">
    <h1>B组件</h1>
    {{flag}}
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue"

// 常规写法 父传子
/* type Props = {
  flag: boolean
}

defineProps<Props>() */

// bus 事件总线写法
import Bus from "../bus"
let flag = ref(false)

Bus.on("on-click", (res: boolean) => {
  console.log(res)
  flag.value = res
})

</script>

<style>
.B {
  width: 200px;
  height: 200px;
  color: rgb(171, 32, 76);
  background-color: chartreuse;
}
</style>